import React from 'react'
import { createBrowserRouter,RouterProvider } from 'react-router-dom'
import About from './pages/About'
import Home from './pages/Home'
import Layout from './pages/Layout'
import KeepAlive from './KeepAlive'

const routes = [
  {
    path: '/',
    element: <Layout />,
    children: [
      {
        path: '/home',
        element: <Home />
      },
      {
        path: '/about',
        element: <About />
      }
    ]
  },
]
const router = createBrowserRouter(routes)
export default function App() {
  return (  
    <div>
      <keepAlive keepPath={['/home']}>
        <RouterProvider router={router} />
      </keepAlive>
    </div>
  )
}
